nwnfandomcom-20200213-history
Talk:Gate
sweet Sweet. 99.236.215.45 01:15, 25 December 2007 (UTC) Gated hostility Do those scripted functions in nw_c2_gated really apply? I have inserted an automatic dispelling in the gate spell script so that the protection is removed when the spell is cast (after the initial check is made), however, the balor remains a "blue" associate that still fights for me and acknowledges my commands. 22:56, January 29, 2013 (UTC) * They should apply unless RemoveSummonedAssociate() is nonfunctional. Or maybe it needs a trivial delay before it has effect? Did you do dispelling (which could fail) or effect removal? Are you sure all relevant effects got removed? Meh, probably an easier question would be what is the outcome of the check in nw_c2_gated, as that could be checked with a pair of SendMessageToPC() calls. --The Krit (talk) 23:38, January 29, 2013 (UTC) :* I found it; the On-Spawn event occurs before the master is assigned, so a trivial delay is needed. I used DispelMagicAll(100); which is high enough that it should not fail, and I always got feedback that the effect was dispelled. 23:42, January 29, 2013 (UTC) ::* Oh, the master issue. Forgot about that. (It also affects "leveling summons" like the epic vrock, but BioWare did code around it in that case). So it's an even bigger foul-up that nw_c2_gated was used for OnSpawn instead of OnHeartbeat. --The Krit (talk) 00:33, January 30, 2013 (UTC) :::* I just noticed that you added run "only once" for the OnSpawn event in the balor (summoned) article. Technically, for EffectSummonCreature(), the OnSpawn event is actually run twice when fDuration is a non-zero float, once for when the creature is created as a placeholder (invisible to the player) for the summoning animation, and once when it is made a functioning creature and right before it is given a master. Thus, for gate, the OnSpawn event is run 3.0 seconds after the spellscript, and 3.0 seconds after that. When fDuration is 0.0 the two circumstances are combined, so that the OnSpawn event is run only once. 03:26, January 31, 2013 (UTC) ::::* Weird. I wonder if BioWare was aware that the script fired twice. By the way, your end analysis seems to be off. The second firing does not happen for nonzero durations as well, provided the duration is less than the time between script firings (3.0 seconds executed twice; 2.9 seconds executed once). So it's not that the circumstances are combined, but that the second one is never initiated. Basically, at the moment the effect is applied: the creature is created (firing OnSpawn) without being shown, the summoning animation is started, and the effect's duration begins. When the animation ends (3 seconds later, at least for the gate visual), if the creature is still around then the OnSpawn is fired a second time. And the creature is not still around if it was destroyed due to an expiring duration. (Although it is not destroyed for DURATION_TYPE_INSTANT, but that is a different sort of oddness.) --The Krit (talk) 22:20, January 31, 2013 (UTC) :::::* Retest your findings. I have been getting a double firing report for durations of 2.0 and 0.1. fDuration is the time between the two script firings. 22:48, January 31, 2013 (UTC) :::::* Actually are you looking at fDuration within EffectSummonCreature() or fDuration within ApplyEffectToObject(), the former is what I am referencing. 23:30, January 31, 2013 (UTC) ::::::* I was looking at the fDuration parameter to ApplyEffectAtLocation(), not the fDelaySeconds parameter to EffectSummonCreature(). --The Krit (talk) 03:37, February 1, 2013 (UTC) :::::::* So, do we agree that when fDelaySeconds is zero there is only one OnSpawn, and when it is positive there are two, and that fDelaySeconds is the interval between the two scripts firing (and the appearance of the creature) even if it does not match the time it takes for to complete the VFX_FNF_* animation? 12:27, February 1, 2013 (UTC) ::::::::* Well, with the question turned to one of delay rather than duration, I no longer find the issue odd enough to motivate me to test it out for myself (beyond confirming that the OnSpawn does fire twice in some cases -- that part is still odd). So I guess that counts as agreement. --The Krit (talk) 21:33, February 1, 2013 (UTC)